import request from '@/utils/request'

// 文章列表
export function getArticles(pIndex, pSize) {
  return request({
    url: `/api/articles?pageIndex=${pIndex}&pageSize=${pSize}`,
    method: 'get'
  })
}

// 文章更新
export function updateActicle(id, data) {
  return request({
    url: '/api/article/' + id,
    method: 'put',
    data
  })
}

// 文章删除
export function deleteArticles(id) {
  return request({
    url: '/api/article/' + id,
    method: 'delete'
  })
}

// 文章添加
export function addActicles(data) {
  return request({
    url: 'api/article/',
    method: 'post',
    data
  })
}
